from forfood.customer.models import Customer
from forfood.restaurant.models import Restaurant

def find_customer(user):
    try:
        customer = Customer.objects.get(username = user.username)
    except:
        customer = None
        pass
    
    return customer

def find_restaurant(user):
    try:
        restaurant = Restaurant.objects.get(username = user.username)
    except:
    	restaurant = None
        pass
    
    return restaurant

def find_restaurant_by_id(id):
    try:
        restaurant = Restaurant.objects.get(id = id)
    except:
        restaurant = None
        pass
    
    return restaurant
    
def is_customer(user):
    try:
        customer = Customer.objects.get(username = user.username)
    except:
        return False
    return True

def is_restaurant(user):
    try:
        restaurant = Restaurant.objects.get(username = user.username)
    except:
    	return False
    return True
    
def get_manage_page(user):
    return "/"